package org.example.ch08.config;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.info.License;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName OpenApiConfig
 * @Description TODO
 * @Author Kx
 * @Date 2025/9/17 9:44
 * @Version 1.0
 */
@Configuration
// 使用注解装配OpenAPI的内容描述
@OpenAPIDefinition(
        // 基本描述（title、版本、文档描述、以及开源授权）
        info = @Info(
            title = "移动端接口文档",
            version = "1.0",
            description = "NF商城移动端接API接口",
            license = @License(name = "MIT", url = "https://mit.org")
        ),
        // 所有请求需要JWT认证（name属性引用SecurityScheme注解的name）
        security = @SecurityRequirement(name = "JWT")
)
// 设置JWT的认证模式
@SecurityScheme(type = SecuritySchemeType.HTTP, name = "JWT", scheme = "Bearer", in = SecuritySchemeIn.HEADER)
public class OpenApiConfig {

}
